package com.yeyks.app.controller.base.hotel;

import com.yeyks.common.ajax.AjaxResponseBody;
import com.yeyks.commonReference.service.hotel.RoomInfoService;
import com.yeyks.hotel.dto.RoomInfoDetailDTO;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiImplicitParam;
import io.swagger.annotations.ApiOperation;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

/**
 * @Author fuchangshuai
 * @date 2019/3/26 4:27 PM
 */
@Api(tags = "房间接口", description = "房间")
@Slf4j
@RestController("appRoomInfoController")
@RequestMapping(value = "/app/room")
public class RoomInfoController {
    @Autowired
    private RoomInfoService roomInfoService;

    /**
     * 通过房间id获取房间详情
     *
     * @param roomId
     * @return
     */
    @ApiOperation(value = "通过房间id获取房间详情")
    @ApiImplicitParam(paramType = "query", name = "roomId", value = "房间id", required = true, dataType = "int")
    @RequestMapping(value = "/room/detail", method = RequestMethod.POST)
    public AjaxResponseBody<RoomInfoDetailDTO> roomDetail(@RequestParam(name = "roomId") Integer roomId) {
        RoomInfoDetailDTO roomInfoDetail = roomInfoService.roomDetail(roomId);
        return AjaxResponseBody.success(roomInfoDetail);
    }
}
